<!-- 公共头部导航 start -->
<div class="main-navigation">
	<div class="row" >
		<div class="col-sm-12">
			<div class="navbar-header">
				<span class="nav-toggle-button collapsed" data-toggle="collapse" data-target="#main-menu">
				<span class="sr-only">Toggle navigation</span>
					<i class="fa fa-align-justify"></i>
				</span>
			</div>
			<div class="collapse navbar-collapse" id="main-menu">
				<ul class="menu">
					<li role="presentation"><a href="/">首页</a></li>
				</ul>
			</div>
	   	</div>
  	</div>
   	<div class="login" id="login"><a href="/login">登录</a></div>
</div>
<script src="/static/js/base/jquery-3.1.1.min.js"></script>
<script src="/static/js/base/jquery.Query.js"></script>
<script src="/static/js/base/jquery-cookie.js"></script>
<script type="text/javascript">
	$(function(){
		commonApp.init();
		var cateid = $.query.get("cateid");
		//头部导航数据
		$.ajax({
             type: "post",
             async:false,
             url : "/user/articleCate.json",
             data: "{}",
             dataType:"json",
             contentType: "application/json",
             success: function (result){
                 var articleCateList = result.data.dataList;
                 if(articleCateList.length > 0){
	                 var headerCateStr = "";
                	 for(var i=0;i<articleCateList.length;i++){
                		 headerCateStr +='<li role="presentation" id="'+articleCateList[i].id+'"><a href="/articleList?cateid='+articleCateList[i].id+'">'+articleCateList[i].cateName+'</a></li>';
                	 }
                	 $(".menu").append(headerCateStr);
                 }
             }
         });
		//头部导航样式
		if(cateid=="" || cateid==null){
			$(".menu li").eq(0).addClass("nav-current").siblings().removeClass("nav-current");
		}else{
			$(".menu").find("#"+cateid).addClass("nav-current").siblings().removeClass("nav-current");
		}
	});
</script>
<!-- 公共头部导航 end -->